package ioperation;

import book.Book;

import java.util.Comparator;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: dings
 * Date: 2024-05-24
 * Time: 18:55
 */
public class PriceComparator implements Comparator<Book> {//用价格来比较
    @Override
    public int compare(Book o1, Book o2) {
        return o1.getPrice() - o2.getPrice();
    }
}
